Skip to content

make convert_hn() public instead of internal #213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

chrispy-snps
Copy link
Collaborator

Make convert_hn() public instead of internal, to allow for custom heading conversion functions.

@chrispy-snps chrispy-snps requested a review from AlexVonB April 12, 2025 23:18
@AlexVonB
Copy link
Collaborator

This reverts 3466061 which fixed the bug that converting <hn>foo</hn> crashed the converter. Do you see a way to fix both?

@chrispy-snps
Copy link
Collaborator Author

@AlexVonB - there is no <hn> tag in HTML so that was probably just an unfortunate coincidence with the typo.

We could rename convert_hn() to convert_hn_all() (which could still collide with <hn_all>). Or we could use a naming convention other than convert_<name>(), but I'm not sure I like that.

What are your thoughts?

@chrispy-snps chrispy-snps force-pushed the chrispy/make-convert_hn-public branch from 8cda560 to ee8c98f Compare April 19, 2025 17:44
@chrispy-snps
Copy link
Collaborator Author

@AlexVonB - I updated the pull request to use convert_hN() for heading tags, which will not collide because conversion functions specific to tag names are all-lowercase.

@chrispy-snps chrispy-snps force-pushed the chrispy/make-convert_hn-public branch from ee8c98f to fb34e5b Compare April 19, 2025 22:03
Signed-off-by: chrispy <chrispy@synopsys.com>
@chrispy-snps chrispy-snps force-pushed the chrispy/make-convert_hn-public branch from fb34e5b to 960e2cd Compare April 19, 2025 23:19
@AlexVonB
Copy link
Collaborator

Perfect solution! I pondered a bit on the initial problem but this is the best solution

@chrispy-snps chrispy-snps merged commit e29de4e into matthewwithanm:develop Apr 20, 2025
1 check passed
Wuhall pushed a commit to Wuhall/python-markdownify that referenced this pull request May 21, 2025
Signed-off-by: chrispy <chrispy@synopsys.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants